package com.ihr360.payroll.dao;

import com.ihr360.payroll.model.dto.staff.SalaryProfileField;
import com.ihr360.rest.reposity.SimpleRestReposity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;

@RepositoryRestResource
public interface SalaryProfileFieldRepository extends SimpleRestReposity<SalaryProfileField,Long> {


    @Query(value = "delete from SalaryProfileField where code = :code  and companySalaryProfileId = :id ",nativeQuery = true)
    Boolean deleteByCodeAndCompanySalaryProfileId(@Param("code") String code,@Param("id") Long id);

    void deleteByCompanyIdAndId(String companyId, Long id);

    void deleteByCompanyIdAndIdIn(String companyId, List<Long> ids);
}
